<?php

class p_changeLang extends page_controllor 
{
    public function __construct($get_param)
    {
        $this->__need_login = false;
        $this->__need_session = false;
        parent::__construct($get_param);
    }
    
    public function run()
    {
        if($this->get_input(0) == 'eng')
            setcookie(K_COOKIE_LANG , K_LANG_ENG , null , '/' , K5_ROOT_DOMAIN , false , true);
        else 
            setcookie(K_COOKIE_LANG , K_LANG_CHN , null , '/' , K5_ROOT_DOMAIN , false , true);
           
        if($this->get_input(1)) 
            $this->redirect(base64_decode($this->get_input(1)));
        else 
            $this->redirect($_SERVER['HTTP_REFERER']);
    }
}
?>